// 2025/8/14
// ISBN号码

#include <iostream>
using namespace std;

int main() {
    string str; cin >> str;
    int last = 0, cur = 1;
    for(int i = 0; i < 11; i++)
    {
        if(str[i] == '-')
            continue;

        last += (str[i] - '0') * cur;
        cur++;
    }
    last %= 11;
    if(last == 10)
        last = 'X';
    else
        last += '0';

    if(str.back() == last)
        cout << "Right" << endl;
    else
    {
        str.back() = last;
        cout << str << endl;
    }
}
// 64 位输出请用 printf("%lld")